import  {fet} from './constants.js'

const api = {}

// 获取一次性token
api.createOnceToken = params => {
  return fet('/user/v1/captcha/createOnceToken',params,'get')
}
// 注册
api.register = params => {
  return fet('/user/v1/user/register',params,'post')
}
// 登录
api.login = params => {
  return fet('/user/v1/user/login',params,'post')
}
// 预登录
api.preLogin = params => {
  return fet('/user/v1/user/preLogin',params,'post')
}
// 首页banner
api.bannerList = params => {
  return fet('/user/v1/index/bannerList',params,'get')
}
// 登出
api.logout = params => {
  return fet('/user/v1/user/logout',params,'delete')
}
// 修改个人信息
api.updateInfo = params => {
  return fet('/user/v1/user/updateInfo',params,'put')
}
// 发送邮箱验证码
api.sendEmailCode = params => {
  return fet('/user/v1/captcha/sendEmail',params,'post')
}
// 发送手机验证码
api.sendPhoneCode = params => {
  return fet('/user/v1/captcha/sendPhone',params,'post')
}
// 发送code邮箱验证码
api.sendEmailCodelogin = params => {
  return fet('/user/v1/captcha/sendEmailCode',params,'post')
}
// 发送code手机验证码
api.sendPhoneCodelogin = params => {
  return fet('/user/v1/captcha/sendPhoneCode',params,'post')
}
// 发送loginin邮箱验证码
api.sendEmailCodeloginIn = params => {
  return fet('/user/v1/captcha/sendLoginEmailCode',params,'post')
}
// 发送loginin手机验证码
api.sendPhoneCodeloginIn = params => {
  return fet('/user/v1/captcha/sendLoginPhoneCode',params,'post')
}
// 用户绑定状态
api.bindStatus = params => {
  return fet('/user/v1/user/bindStatus',params,'get')
}
// 忘记密码
api.forgetPwd = params => {
  return fet('/user/v1/user/forgetPwd',params,'post')
}
// 绑定邮箱/手机/谷歌
api.bindaccount = params => {
  return fet('/user/v1/user/bind',params,'put')
}
// 重置密码
api.resetPwd = params => {
  return fet('/user/v1/user/resetPwd',params,'put')
}
// 获取谷歌安全绑定的KEY
api.gaSecurityKey = params => {
  return fet('/user/v1/user/gaSecurityKey',params,'get')
}
// 解绑谷歌
api.unbindGa = params => {
  return fet('/user/v1/user/unbindGa',params,'put')
}
// C1认证
api.firstIdentity = params => {
  return fet('/user/v1/user/firstIdentity',params,'put')
}
// C2认证
api.secondIdentity = params => {
  return fet('/user/v1/user/secondIdentity',params,'put')
}
// 基本信息
api.baseinfo = params => {
  return fet('/user/v1/user/info',params,'get')
}
// 登录日志
api.loginLog = params => {
  return fet('/user/v1/user/signInLog',params,'post')
}
// 登录日志列表
api.loginLogList = params => {
  return fet('/user/v1/user/signInLogList',params,'get')
}
// 添加API KEY
api.createApi = params => {
  return fet('/user/v1/api/create',params,'post')
}
// 添加API KEY
api.apiList = params => {
  return fet('/user/v1/api/list',params,'get')
}
// 删除API KEY
api.deleteList = params => {
  return fet('/user/v1/api/delete',params,'delete')
}
// 收款设置列表
api.paymentlist = params => {
  return fet('/user/v1/payment/payList',params,'get')
}
// 添加收款方式
api.bindPayWay = params => {
  return fet('/user/v1/payment/createOrUpdate',params,'post')
}
// 上传
api.uploadImg = params => {
  return fet('/user/v1/file/upload',params,'post')
}
// 资产列表
api.assetsList = params => {
  return fet('/user/v1/account/list',params,'get')
}
// 资产变动
api.assetValuation = params => {
  return fet('/user/v1/account/assetValuation',params,'get')
}
// 资产分布
api.assetDistribution = params => {
  return fet('/user/v1/account/assetDistribution',params,'get')
}
// 添加地址标签
api.createOrEditAddressTag = params => {
  return fet('/user/v1/account/createOrEditAddressTag',params,'post')
}
// 删除提币地址标签
api.deleteAddressTag = params => {
  return fet('/user/v1/account/deleteAddressTag/',params,'delete')
}
// 提币地址标签列表
api.addressTagList = params => {
  return fet('/user/v1/account/addressTagList',params,'get')
}
// 用户单个币种信息
api.findByCurrencyId = params => {
  return fet('/user/v1/account/findByCurrencyId',params,'get')
}
// 币种列表
api.coinsList = params => {
  return fet('/user/v1/currency/list',params,'get')
}
// 充币
api.deposit = params => {
  return fet('/user/v1/account/deposit',params,'get')
}
// 提币
api.withdraw = params => {
  return fet('/user/v1/account/withdraw',params,'post')
}
// 充提列表
api.transactionList = params => {
  return fet('/user/v1/account/transactionList',params,'get')
}
// 撤销委托
api.cancelorder = params => {
  return fet('/order/v1/order/cancel',params,'put')
}
// 当前委托列表
api.currentOrderList = params => {
  return fet('/order/v1/order/currentOrderList',params,'get')
}
// 历史委托列表
api.historyOrderList = params => {
  return fet('/order/v1/order/historyOrderList',params,'get')
}
// 历史成交列表
api.execList = params => {
  return fet('/order/v1/order/execList',params,'get')
}
// 邀请好友列表
api.inviteList = params => {
  return fet('/user/v1/user/inviteList',params,'get')
}
// 获取用户可用支付方式
api.userPayMode = params => {
  return fet('/c2c/v1/payment/userPayMode',params,'get')
}
// 支付方式
api.paymentList = params => {
  return fet('/c2c/v1/payment/list',params,'get')
}
// 创建广告
api.createAdvert = params => {
  return fet('/c2c/v1/advert/create',params,'post')
}
// 币种列表
api.currency = params => {
  return fet('/c2c/v1/comm/currency',params,'get')
}
// 法币类型
api.legalCurrency = params => {
  return fet('/c2c/v1/comm/legalCurrency',params,'get')
}
// 我的广告
api.myAd = params => {
  return fet('/c2c/v1/advert/myAd',params,'get')
}
// 下架
api.adDisable = params => {
  return fet('/c2c/v1/advert/disable',params,'put')
}
// 上架
api.adEnable = params => {
  return fet('/c2c/v1/advert/enable',params,'put')
}
// 编辑广告
api.editAdvert = params => {
  return fet('/c2c/v1/advert/edit',params,'put')
}
// 我的广告-详情
api.adDetail = params => {
  return fet('/c2c/v1/advert/detail',params,'get')
}
// 市场广告列表
api.adList = params => {
  return fet('/c2c/v1/advert/list',params,'get')
}
// 交易市场-广告信息
api.adInfo = params => {
  return fet('/c2c/v1/advert/info',params,'get')
}
// 创建订单
api.createOrder = params => {
  return fet('/c2c/v1/order/create', params, 'post')
}
// 我的订单
api.orderList = params => {
  return fet('/c2c/v1/order/list', params, 'get')
}
// 订单详情
api.orderDetail = params => {
  return fet('/c2c/v1/order/detail', params, 'get')
}
// 确认支付
api.orderPay = params => {
  return fet('/c2c/v1/order/pay', params, 'put')
}
// 取消订单
api.orderCancel = params => {
  return fet('/c2c/v1/order/cancel', params, 'put')
}
// 今日取消订单数量
api.cancelOrderCount = params => {
  return fet('/c2c/v1/order/cancelLimit', params, 'get')
}
// 确认收款
api.orderReceive = params => {
  return fet('/c2c/v1/order/receive', params, 'put')
}
// 根据订单id查找对应的申诉详情
api.getAppeal = params => {
  return fet('/c2c/v1/appeal/getAppeal', params, 'get')
}
// 保存申诉详情
api.saveAppeal = params => {
  return fet('/c2c/v1/appeal/saveAppeal', params, 'post')
}
// 获取一次性token
api.getOnceToken = params => {
  return fet('/c2c/v1/captcha/createOnceToken',params,'get')
}
// 添加工单
api.createJob = params => {
  return fet('/user/v1/job/create', params, 'post')
}
// 工单模块列表
api.jobList = params => {
  return fet('/user/v1/job/list', params, 'get')
}
// 工单模块列表详情
api.jobInfo = workOrderId => {
  return fet(`/user/v1/job/info/${workOrderId}`, null, 'get')
}
// announcement列表
api.announcementList = params => {
  return fet('/user/v1/announcement/list', params, 'get')
}
// announcement详情
api.announcementInfo = articleId => {
  return fet(`/user/v1/announcement/info/${articleId}`, null, 'get')
}
// 查询所有资讯类别
api.allArticleType = params => {
  return fet('/user/v1/announcement/allArticleType', params, 'get')
}
// 查询资讯类别
api.articleType = params => {
  return fet('/user/v1/announcement/articleType', params, 'get')
}
// 查询资讯类别的子类
api.articleTypeList = params => {
  return fet('/user/v1/announcement/articleTypeList', params, 'get')
}
// announcement搜索
api.announcementSearch = params => {
  return fet('/user/v1/announcement/search', params, 'get')
}
// 读取字典下拉
api.selectList = params => {
  return fet('/user/v1/sys/dict/selectList', params, 'get')
}
// 获取参考价
api.getProposedPrice = params => {
  return fet('/c2c/v1/comm/proposedPrice', params, 'get')
}
// 发送普通点对点消息 ###仅用于测试
api.sendMsg = params => {
  return fet('/c2c/v1/im/sendMsg', params, 'post')
}
// 发送自定义系统通知 ###仅用于测试
api.sendAttachMsg = params => {
  return fet('/c2c/v1/im/sendAttachMsg', params, 'post')
}
// 获取站内信列表
api.getUserMessageList = params => {
  return fet('/user/userMessage/list', params, 'get')
},
//获取未读数量
api.getUnreadCount = params => {
  return fet('/user/userMessage/getUnreadCount', params, 'get')
},
//修改站内信为已读
api.updateRead = params => {
  return fet('/user/userMessage/updateRead', params, 'post')
}
// 修改全部站内信为已读
api.updateReadAll = params => {
  return fet('/user/userMessage/updateReadAll', params, 'post')
}
// 用户单个币种信息
api.findByCurrencyCode = params => {
  return fet('/user/v1/account/findByCurrencyCode', params, 'get')
}
// 点赞
api.postAnnouncementLike = (articleId, params) => {
  return fet(`/user/v1/announcement/like/${articleId}`, params, 'post')
}
// 获取游戏信息
api.getGameUserInfo = params => {
  return fet('game/api/getGameUserInfo', params, 'get')
}
// 获取游戏登录参数
api.getGameUrl = params => {
  return fet('game/api/getUrl', params, 'get')
}
// 更新用户游戏昵称
api.updateNikeName = params => {
  return fet('game/api/updateNikeName', params, 'put')
}
// 支持的交易方式
api.currencyTradeWay = params => {
  return fet('/user/v1/pair/currencyTradeWay', params, 'get')
}
// 查询版本
api.getVersion = (platform, params) => {
  return fet(`user/v1/system/versions/getVersion/${platform}`, params, 'get')
}
// 分时期权交割队列
api.deliveryList = params => {
  return fet('/user/v1/future/deliveryList', params, 'post')
}
// 分时期权分析
api.recordSummary = params => {
  return fet('/user/v1/future/recordSummary', params, 'post')
}
// 分时期权资金流水
api.flowRecord = params => {
  return fet('/user/v1/future/fund/flowRecord', params, 'post')
}
// 返佣记录列表
api.rakeBacklist = params => {
  return fet('/user/rakeBack/list', params, 'get')
}
// 返佣记录汇总
api.summary = params => {
  return fet('/user/rakeBack/summary', params, 'get')
}
// 导出订单列表
api.export = params => {
  return fet('/c2c/v1/order/orderList', params, 'get')
}
// 返水
api.getRebateAmount = params => {
  return fet('/game/api/getRebateAmount', params, 'get')
}

// 币种资料
api.getCoinIntro = params => {
  return fet('/user/v1/currency/coinIntro', params, 'get')
}
// 法币支持币种
api.getCurrencies = params => {
  return fet('/c2c/v1/comm/currencies', params, 'get')
}
// 申请商家
api.c2cMerchantApply = params => {
  return fet('/user/v1/user/c2cMerchantApply',params,'post')
}

// 申请商家需要冻结多少金额
api.getByDictKey = params => {
  return fet('/user/v1/sys/dict/getByDictKey',params,'get')
}
// 共识列表
api.ieoList = params => {
  return fet('/user/v1/ieo/list', params, 'get')
}
// 共识详情
api.ieoInfo = ieoId  => {
  return fet(`/user/v1/ieo/info/${ieoId }`, null, 'get')
}
// 共识申购
api.ieoBuy = params  => {
  return fet(`/user/v1/ieo/exchange`, params, 'post')
}
export {api}
